<template>
	<view>
		<view class="wenzi">
			<u-row class="top" customStyle="margin-bottom: 10px">
				<u-col class="top1" span="6">
					<view class="demo-layout bg-purple-light">
						<text class="jifen">{{integralList.score}}</text>
					</view>
				</u-col>
				<u-col class="top2" span="6">
					<view class="demo-layout bg-purple">
						<u-button class="btn" type="primary" shape="circle" text="积分规则"></u-button>
					</view>
				</u-col>
			</u-row>

		</view>
		<view class="danyuange">
			<u-cell-group>
				<u-cell icon="rmb-circle" title="交易记录" value=">" @click="fn1"></u-cell>
				<u-cell icon="gift" title="积分兑换" value=">" ></u-cell>
				<u-cell icon="calendar" title="签到赠送积分" value=">"></u-cell>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	import {_integral} from "../../api/integral.js"
	
	export default {
		data() {
			return {
				integralList: []
			}
		},
		methods: {
			// 交易记录
			fn1(){
				uni.navigateTo({
					url:"/pages/scoreLog/scoreLog"
				})
			},
			getintegralList() {
				_integral().then(res=>{
					console.log(res)
					if(res.code === 0){
						this.integralList = res.data
					}
				})
			}
		},
		onReady(){
			if(!uni.getStorageSync("token")){
				uni.redirectTo({
					url:"../login/login"
				})
			}else{
				this.getintegralList()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.top {
		height: 80px;
		background-color: gray;

		.top1 {
			height: 80px;

			.jifen {
				font-size: 24px;
				font-weight: 500;
				line-height: 80px;
				margin-left: 10px;
			}
		}

		.top2 {
			height: 80px;

			.btn {
				width: 80px;
				height: 30px;
				margin-top: 27px;
				margin-right: 20px;
			}

		}
	}
</style>
